using System;
using System.Data;

namespace TimeSheetBLL.Brokers
{
	/// <summary>
	/// A nice description of AdministratorBroker goes here.
	/// 
	/// Version: $Id: AdministratorBroker.cs,v 1.2 2004/05/18 15:33:20 jperrin Exp $
	/// 
	/// Date: 
	/// Copyright: 2004, Kanga Communications, Calgary, Alberta, Canada. 
	/// </summary>
	public class AdministratorBroker:Broker
	{

		public AdministratorBroker() : base()
		{
			
		}

		public override DataTable SelectAll( IDBEntity entity )
		{
			string statement = "SELECT * FROM administrator WHERE active > 0 ORDER BY admin_name";
			return this.data.GetTable( statement );
		}

		public override bool Delete( IDBEntity entity )
		{
			string statement = "UPDATE administrator SET active = 0 WHERE admin_id = " + entity.ID;
			return this.data.ExecuteNonQuery( statement ) > 0;
		}
	}
}
